package com.yunhe.uitl;

import com.yunhe.dao.MyselfDao;
import com.yunhe.javabean.Myself;
import com.yunhe.service.MyselfService;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyselfTest {

    static ClassPathXmlApplicationContext cpac;
    static {
        cpac=new ClassPathXmlApplicationContext("spring.xml");
    }

    @Test
    public void dao(){
        MyselfDao myselfDao = (MyselfDao) cpac.getBean("myselfDao");
        myselfDao.selectAll();
    }
    @Test
    public void myself(){
        Myself myself = (Myself) cpac.getBean("myself");
        System.out.println(myself);
    }



    @Test
    public void LifeWeek(){
        cpac.close();
    }

    @Test
    public void myself_Service(){
        MyselfService myselfService = (MyselfService) cpac.getBean("myselfService");
        myselfService.findAll();
    }
}
